package day0813;

/**
 * @Author:galaxy_yan
 * @Date: 2022/8/15
 * @Time: 9:09
 * @Description
 * 作业标题(1698)
 * 返回的数字之和
 */
public class text4 {
    public static void main(String[] args) {
        System.out.println(sum(123456));
    }
    public static int sum(int n){
        if(n<10){
            return n;
        }
        return n%10+sum(n/10);
    }
}
